#pragma once

namespace LSH
{
namespace GUI
{

class Event;

class EventSet
{
public:
    EventSet(void);
    ~EventSet(void);
public:
	void    addEvent(const String& name);
	void    removeEvent(const String& name);
	void    removeAllEvents();
	bool    isEventPresent(const String& name);

	virtual bool subscribeEvent(const String& name, SlotFunctorBase* slot);
	virtual void fireEvent(const String& name, EventArgs& args);

	bool    isMuted() const;
	void    setMutedState(bool setting);

protected:
	Event*  getEventObject(const String& name, bool autoAdd = false);
	void    fireEvent_impl(const String& name, EventArgs& args);
protected:
	typedef std::map<String, Event*>    EventMap;
    typedef EventMap::iterator          eventItr;
    typedef EventMap::value_type        eventValue;
protected:
	EventMap    _events;
    bool        _muted;
};

} // GUI
} // LSH
